Skip to content

Commonly Used Extensions - Visual Studio

TLDR

  • Extension Management: It is recommended to use an "independent list" rather than installing large bundles to avoid issues with overlapping features, outdated components, or incomplete uninstallation.
  • Font Selection: Cascadia Mono is recommended; it is designed for code and performs excellently on high-resolution screens. Avoid Cascadia Code to prevent ligatures from causing confusion in symbol interpretation.
  • Entity Framework Core: For projects not building Entities, you only need to install Microsoft.EntityFrameworkCore, a database provider (e.g., SqlServer), and Relational.
  • Log Management: Serilog is recommended. Its structured logging (Data) is far superior to the traditional text-based logging of NLog. It is recommended to pair it with Seq for visual debugging.
  • DI Enhancement: Use Scrutor to fill the gap where Microsoft's native DI does not support Assembly Scanning.
  • Reverse Proxy: Microsoft's official YARP has replaced Ocelot as the top choice for new projects due to its high integration with .NET and superior performance.
  • Compression Packages: If there are requirements for data to remain in-memory or for encryption, prioritize using native System.IO.Compression or in-memory processing packages to avoid security risks caused by calling external 7z.exe and generating temporary files.

Visual Studio Extension Recommendations

In the Visual Studio development environment, it is recommended to break down large bundles into individual extensions.

You may encounter management chaos when you are accustomed to installing large bundles like "Productivity Power Tools" or "Web Essentials".

  • Opaque Content: You cannot precisely track which tools are installed, and the content often changes with versions.
  • Overlapping and Outdated Features: With Visual Studio updates, many old features have been replaced by built-in functionality (e.g., Zen-Coding).
  • Incomplete Removal: When removing a bundle, sub-extensions often remain in the environment.
  • Productivity Power Tools Related:
    • Double-Click Maximize 2022: Double-click to maximize the window.
    • Fix Mixed Tabs: Detects and converts mixed usage of Tabs and spaces.
    • Middle Click Scroll: Use the mouse wheel to scroll through documents.
    • Solution Error Visualizer: Displays error hints in Solution Explorer.
  • Dev Essentials Related:
    • File Icons: Beautifies file icons.
    • SVG Viewer: Optimizes SVG preview and editing.
    • Editor Enhancements: Enhances code sorting and encoding features.
    • Markdown Editor v2: Enhances the Markdown editing experience.
    • Image Optimizer: Image compression.
  • Other Useful Tools:
    • ResXManager: Multi-language management, provides an Excel-like interface.
    • Editor Guidelines: Sets code length guide lines (recommended 80, 100, 120 chars).
    • VSColorOutput: Adds color differentiation to Build messages in the Output window.

Visual Studio Environment and Editor Settings

Display and Font Optimization

When to adjust fonts: When you are developing for long periods on a high-resolution screen.

  • Font Selection: Cascadia Mono (size 12) is recommended.
  • Avoiding Ligature Issues: Choosing Cascadia Mono instead of Cascadia Code is to avoid ligature effects like != automatically converting to , which can cause confusion in symbol interpretation.
  • Screen Display: If the mouse pointer behaves erratically during operation (common in SQL files), try disabling "Optimize rendering for screens with different pixel densities".

Advanced Editor Settings

  • Document Tabs: It is recommended to set the position to "Left" or "Right" to increase vertical reading space, and enable "Color tabs by project or file type".
  • C# Advanced Settings:
    • Outlining: Enable "Show procedure line separators" to use white lines to separate methods and properties.
    • Fading: Enable fade-out reminders for redundant Usings and variables.
    • Editor Help: Enable "Underline reassigned variables" to make it easier to track variable states.

NuGet Package Selection Strategy

Database and ORM

  • EF Core: For projects not building Entities, you only need to install Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.SqlServer (or the corresponding provider), and Microsoft.EntityFrameworkCore.Relational.
  • Dapper: The top choice for a lightweight ORM.
  • EF Core Power Tools: Provides a graphical interface for reverse engineering, making it easy to generate Models from a database.

Logging and Architecture Enhancement

  • Serilog.AspNetCore: The modern standard for structured logging.
    • Core Concept: Log "data" rather than "strings". For example, Log.Info("User {Id}", id) treats Id as a searchable field.
    • Recommended Combination: Pair with Serilog.Sinks.Seq for visual debugging.
  • Scrutor: Enhances Microsoft's native DI, filling the gap where Assembly Scanning is not supported.

Networking and Compression

  • YARP: The official reverse proxy package led by Microsoft. It performs better than Ocelot and is suitable for new projects.
  • Compression Package Selection:
    • If the project already has NPOI, you can directly use its dependency SharpZipLib.
    • If there are no special dependencies, DotNetZip is sufficient.
    • Security Reminder: Avoid calling external programs like 7z.exe. Use native System.IO.Compression or in-memory processing instead to prevent sensitive data leaks caused by residual temporary files.

Project Versioning

  • MinVer: Suitable for lightweight projects; determines the version based on Git Tags.
  • GitVersion.MsBuild: Suitable for projects with complex branching strategies (e.g., GitFlow).

Change Log

  • 2022-11-10 Initial document creation.
  • 2025-04-06
    • Added settings instructions for "Automatically update extensions".
    • Removed "Code Cleanup on Save" as it has been built into Visual Studio 2022 for a long time and does not need to be listed separately.
    • Updated descriptions for some packages.
  • 2025-12-31
    • Removed outdated and commercial-license-required packages.
    • Updated Visual Studio setting recommendations; now recommending the Cascadia font family.
    • Added packages such as YARP, Scrutor, and MQTTnet.